import reqwest from 'reqwest';

// 用户登录
export const onLogin = ({commit}, obj) => {
    obj.clientId = '098f6bcd4621d373cade4e832627b4f6';
    console.log('onLogin参数：', obj);
    reqwest({
        url: 'http://139.196.141.171:8080/jwt/oauth/token',
        method: 'post',
        contentType: 'application/json;charset=UTF-8',
        crossOrigin: true,
        data: JSON.stringify(obj),
        dataType: 'json',
    }).then(msg => {
        console.log('成功', msg);
        commit({
            type: 'onLogin',
            msg: 'Hello World'
        });
    }).catch(msg => {
        console.log('失败：', msg);
    });
};